﻿<views:EntityView x:Class="Conference.UX.Wpf.Views.SpeakerListEntityView"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:tcl="clr-namespace:TeaLightV5.Foundation.UX.Wpf.Controls;assembly=TeaLightV5.Foundation.UX.Wpf"
                   xmlns:views="clr-namespace:TeaLightV5.Foundation.UX.Wpf.Views;assembly=TeaLightV5.Foundation.UX.Wpf"
                   mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0" >
            <TextBlock Text="Speaker" />
        </StackPanel>

        <ListBox Grid.Row="1" ItemsSource="{Binding Data}"
            HorizontalContentAlignment="Stretch">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <tcl:StackPanel TapCommand="{Binding ReadCommand}"> 
                        <tcl:StackPanel DataContext="{Binding Data}">                      
                            <TextBlock Text="{Binding Name}"  />
                            <TextBlock Text="{Binding Title}" />
                        </tcl:StackPanel>
                    </tcl:StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>

        <StackPanel Grid.Row="2">
            <Button Command="{Binding AddCommand}">Add</Button>
            <Button Command="{Binding RefreshCommand}">Refresh</Button>
        </StackPanel>

    </Grid>
</views:EntityView>
